<?php

/**
 * Ares api error code definition 
 * 
 * @author xingkun
 * @date 2014/11/07
 */
class ApiError {

    //系统级错误(发送HTTP头信息)
    static $httpErrorMapping = array(
        '401' => 'You must be authorized to view this resource.',
        '404' => 'The resource {%(parameter)s} you request was not found.',
        '500' => 'The server encountered an error processing your request.',
        '501' => 'The request {%(parameter)s} can not released temporarily.',
        '503' => 'The Service is unavailable',
    );
    //API级错误列表
    static $apiErrorMapping = array(
        //System
        '1000001' => 'Invalid API Method(System)',
        '1000002' => 'Invalid Token (System)',
        '1000003' => 'Time error over 10min (System)',
        '1000004' => 'Invalid response format (System)',
        '1000005' => 'Invalid API version (System)',
        '1000006' => 'Invalid APP Client (System)',
        '1000007' => 'Invalid APP Key (System)',
        '1000008' => 'Invalid Request Method (System)',
        '1000009' => 'Language is not supported (System)',
        '1000010' => 'Currency is not supported (System)',
        '1000011' => 'Authentication failed (System)',
        '1000012' => 'Time out (System)',
        '1000013' => 'Data error (System)',
        '1000014' => 'DataBase error (System)',
        '1000015' => 'Server error (System)',
        '1000016' => 'Permission denied (System)',
        '1000017' => 'Service unavailable (System)',
        '1000018' => 'Invalid signature (System)',
        '1000019' => 'Invalid parameter: {%(parameter)s} (System)',
        '1000020' => 'Missing required parameters: {%(parameter)s} (System)',
        '1000021' => 'Parameter {%(parameter)s} should not be empty. (System)',
        '1000022' => 'Server Busy (System)',
        //API
        '1000090' => 'Missing required parameters: {%(parameter)s} (API)',
        '1000091' => 'Parameter {%(parameter)s} should not be empty. (API)',
        '1000092' => 'Parameter {%(parameter)s} should by at least {%(min_length)d} characters long. (API)',
        '1000093' => 'Parameter {%(parameter)s} can not exceed {%(max_length)d} characters long. (API)',
        '1000094' => 'Parameter {%(parameter)s} must be a postive integer. (API)',
        '1000095' => 'Parameter {%(parameter)s} must be a valid email. (API)',
        '1000096' => 'Parameter {%(parameter)s} must be a boolean. (API)',
        '1000097' => 'Invalid value of parameter: {%(parameter)s}. (API)',
        '1000098' => 'Parameter {%(parameter)s} must be digital. (API)',
        '1000099' => '%(parameter)s not found in our system. (API)',
        '1000100' => 'Internal api error (API)',
        //User
        '1001001' => 'Invalid username or password (User)',
        '1001002' => 'Customer not logged in. (User)',
        '1001003' => 'Invalid password. (User)',
        '1001004' => 'An account already exists for this email address. (User)',
        '1001005' => 'An account already exists for this phone. (User)',
        '1001006' => 'An account already exists for this phone. (User)',
        '1001007' => 'Our system could not find account registed by {%(parameter)s}, please register first. (User)',
        '1001008' => 'new password should not be same as old password. (User)',
        '1001009' => 'Confirm password and password do not match. (User)',
        '1001010' => 'Invalid Gender (User)',
        '1001011' => 'An account has not registered by this email address, please register first. (User)',
        '1001012' => 'Can not remove favorite this {%(parameter)s} because it is favorited.(User)',
        '1001013' => 'Can not remove history this {%(parameter)s} because it is browsed.(User)',
        '1001014' => 'No stream data.(User)',
        '1001015' => 'Fail to write data.(User)',
        '1001016' => 'Reset password error.(User)',
    );

}

?>